from train import *


class day:
    # private
    def __init__(self, data):
        self.sleep = 0  # 卧票数量
        self.trainnum = 0  # 火车数量
        self.train = []
        for i in data:
            t = train(i)
            self.train.append(t)
            sleep = train.GetSleep(t)
            self.sleep += sleep
            self.trainnum += 1

    # public
    def GetSleep(self):
        return self.sleep

    def GetTicknum(self):
        return self.trainnum

    def GetTrain(self, num):
        return self.train[num - 1]

    def GetDate(self):
        a = []
        for i in range(0, self.trainnum - 1):
            b = []
            t = self.train[i]
            b.append(train.GetTrainNum(t))
            b.append(train.GetStartNum(t))
            b.append(train.GetStartStation(t))
            b.append(train.GetStartNum(t))
            b.append(train.GetStopStation(t))
            b.append(train.GetStartTime(t))
            b.append(train.GetStopTime(t))
            b.append(train.GetStopTime(t))
            b.append(train.GetTime(t))
            b.append(train.GetSpecial(t))
            b.append(train.GetFirst(t))
            b.append(train.GetSecond(t))
            b.append(train.GetSleepSoft(t))
            b.append(train.GetSleepHard(t))
            b.append(train.GetSeatHard(t))
            b.append(train.GetStand(t))
            a.append(b)
        return a